import java.util.Scanner;

public class Test {
    //字符串中找出最长数字串
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            String str = scanner.nextLine();
            System.out.print(numberString(str));
        }
    }
    public static String numberString(String str){
        if(str == null){
            return null;
        }
        //使用StringBuilder来接收数字串
        StringBuilder stringBuilder1 = new StringBuilder();
        StringBuilder stringBuilder2 = new StringBuilder();
        for (int i = 0; i < str.length(); i++) {
            //用一个j控制数字字符开始添加的位置
            int j = i;
            //每次循环清空stringBuilder，让stringBuilder从头开始接受数字串
            if(stringBuilder1!= null) {
                stringBuilder1.delete(0, stringBuilder1.length());
            }
            //遇到数字字符开始往stringBuilder添加字符，j的下标要控制，不然会发生越界
            while(j < str.length() && str.charAt(j) >= '0' && str.charAt(j) <= '9'){
                stringBuilder1.append(str.charAt(j));
                j++;
            }
            //用一个字符串str1来接收stringBuilder1
            String str1 = stringBuilder1.toString();
            //判断字符串的长度是否大于stringBuilder2
            if(str1.length() > stringBuilder2.length()){
                //满足条件，清空 stringBuilder2上一次接收的值
                stringBuilder2.delete(0, stringBuilder1.length());
                //再次赋值
                stringBuilder2.append(str1);
            }
        }
        return  stringBuilder2.toString();
    }

}
